package com.tiandawu.injectframwork;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.tiandawu.injectframwork.annotation.ContentView;
import com.tiandawu.injectframwork.annotation.OnClick;
import com.tiandawu.injectframwork.annotation.OnLongClickListener;
import com.tiandawu.injectframwork.annotation.ViewInject;

@ContentView(R.layout.activity_main)
public class MainActivity extends BaseActivity {

    @ViewInject(R.id.text_view)
    TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mTextView.setText("inject text into text_view");
    }


    @OnClick({R.id.text_view})
    public void showToast(View view) {
        Toast.makeText(this, "proxy show", Toast.LENGTH_SHORT).show();
    }

    @OnLongClickListener(R.id.text_view)
    public boolean onLongClick(View view) {
        Toast.makeText(this, "long click", Toast.LENGTH_SHORT).show();
        return true;
    }
}
